﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using Koonsoft.HYCRM.BLL;

public partial class Accountant_PageTwo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

            string company = Request.QueryString["CompanyID"];
            string year = Request.QueryString["year"];
            var v = new CompanyBLL().GetCompanyByCompanyid(company);

            StringBuilder sb = new StringBuilder();
            sb.AppendFormat("<div>{0}</div>", v.EnglishName);
            sb.AppendFormat("<div>REPORT OF THE SOLE DIRECTOR</div>");
            sb.AppendFormat(
                "<div>The sole director has pleasure in submitting his annual report together with the audited financial statements for the year ended 31st December, {0}.</div>",
                year);
            sb.AppendFormat("<div>FINANCIAL STATEMENTS</div>");
            sb.AppendFormat(
                "<div>The state of the company’s affairs at 31st December, {0} is set out in the financial statements on pages {1} to {2}.</div>",
                year, 0, 0);
            sb.AppendFormat(
                "<div>The sole director does not recommend the payment of a dividend in respect of the year ended 31st   December, {0}.</div>",
                year);
            sb.AppendFormat("<div>DIRECTOR</div>");
            sb.AppendFormat("<div>The director during the financial year was:</div>");

            foreach (var diector in new CompanyBLL().GetCompanyDiectors(company).Where(fun => fun.ISDirector == 1))
            {
                sb.AppendFormat("<div>{0}</div>", diector.EnglishName);
            }

            sb.AppendFormat("<div>AUDITORS</div>");
            sb.AppendFormat("<div>{0}</div>", new AuditorsBLL().GetEvaluation(company, year));
            sb.AppendFormat("<div>Director</div>");
            sb.AppendFormat("<div>Hong Kong,</div>");

            Label1.Text = sb.ToString();
        }
    }
}